package Service

import SQL.DatabaseHelper
import android.content.ContentValues
import android.content.Context



class RegistrationService( private val context: Context) {
    fun registerUser(username: String, password: String): Boolean {
        val databaseHelper = DatabaseHelper(context)
        val db = databaseHelper.writableDatabase

        val values = ContentValues()
        values.put(DatabaseHelper.COLUMN_USERNAME, username)
        values.put(DatabaseHelper.COLUMN_PASSWORD, password)

        val result = db.insert(DatabaseHelper.TABLE_NAME, null, values)

        db.close()
        databaseHelper.close()

        return result!= -1L
    }
}